#!/bin/bash
#SBATCH --job-name=whl
#SBATCH --mail-user=weihl18@lzu.edu.cn
#SBATCH -J whl
#SBATCH -p gpu8
#SBATCH --nodes=1 
#SBATCH -n 1 
#SBATCH --ntasks-per-node=1
#SBATCH --gres=gpu:8            # 每个节点上申请一块GPU卡
#SBATCH --get-user-env
#SBATCH --time=120:00:00


#export OMP_NUM_THREADS=4
#export OMPI_COMM_WORLD_LOCAL_RANK=1
#export QUDA_ENABLE_GDR=1
mkdir -p ./tmp/chroma_quda
QUDA_RESOURCE_PATH=./tmp/chroma_quda/
QDP_TEMP=./tmp/chroma_qdp_tmp/
uname -n


echo "============started run " `date`  "==================="
echo "conf_st conf_ed conf_int" ${conf_st} ${conf_ed} ${conf_int}
date
start_time=`date +%s`

#python ./RunChroma.py ${conf_st} ${conf_ed} ${conf_int}
python ./RunChroma.py $1 $2 $3
#rungpu purgaug -geom 1 1 1 1 -i purgaug.ini.xml -o outfiles/purgaug.out.xml -l outfiles/purgaug.log.xml >outfiles/purgaug.txt 2>&1
#mpirun -np 8 purgaug -i purgaug.ini.xml -o outfiles/purgaug.out.xml -l outfiles/purgaug.log.xml >outfiles/purgaug.txt 2>>outfiles/purgaug.task  

date
end_time=`date +%s`
time_used=$((end_time - start_time))
alltime=${time_used}
echo "all time used is $((alltime / 3600))h : $(( (alltime % 3600) / 60 ))m : $(( alltime % 60 ))s "
echo "           "

